home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 2000 #2 / Sun Solutions CD (Volume 2 2000)(Special Focus - Java Technologies)(Disc 1).ISO / products / bin / update.csh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2000-01-05  |  20KB  |  515 lines

  1. #! /bin/csh 
  2.  
  3.  
  4.  
  5. #
  6. # Create the category pages seen in the categories.txt file
  7. #
  8.  
  9. # check if root user
  10. setenv USER `/usr/ucb/whoami`
  11. if ( "$USER" != "root" ) then
  12.   echo " "
  13.   echo "This program must be run as root user."
  14.   echo " "
  15.   exit 1
  16. endif
  17.  
  18. setenv CATS false
  19. setenv APPLETS false
  20. setenv COMP false
  21. setenv PROD false
  22. setenv PLATFORM sparc
  23.  
  24. # parse command line arguements
  25. setenv ARGC `echo $argv|wc -w`
  26. # only check command line options if they exist
  27. if ( $ARGC ) then
  28.   foreach OPTION ($*)
  29.     echo "OPTION = "$OPTION
  30. # check if the current option is the source image directory name
  31. #    if ( $SRC_DIR == $NOT_DEFAULT ) then
  32. #      setenv SRC_DIR $OPTION
  33. #      echo "Using $SRC_DIR as the target directory."
  34. # check if the option is really a directory
  35. #      if ( ! -d $SRC_DIR ) then
  36. #        echo "$SRC_DIR is not a directory."
  37. #        exit 1
  38. #      endif
  39. #    endif
  40.  
  41.     switch ($OPTION)
  42.     case '-cats'      :  
  43.                         setenv CATS true 
  44.                         breaksw
  45.     case '-applets'   :
  46.                         setenv APPLETS true
  47.                         breaksw
  48.     case '-comp'      :  
  49.                         setenv COMP true 
  50.                         breaksw
  51.     case '-prod'      :
  52.                         setenv PROD true
  53.                         breaksw
  54.     case '-all'      :  
  55.                         setenv PROD true 
  56.                         setenv COMP true 
  57.                         setenv APPLETS true
  58.                         setenv CATS true 
  59.                         breaksw
  60.     case '-x86'       :  
  61.                         setenv PLATFORM x86
  62.                         setenv SRC_DIR ../../../x86.image
  63.                         breaksw
  64.     default           :  
  65.                         echo "Usage: update.csh [ -cats | -applets | -comp | -prod | -all | -x86  ]"
  66.                         exit 0
  67.                         breaksw
  68.     endsw
  69.   end
  70. else
  71.   setenv PROD true 
  72.   setenv COMP true 
  73.   setenv APPLETS true
  74.   setenv CATS true 
  75. endif
  76.  
  77.  
  78. #
  79. # Category creation bases on categories.txt file
  80. #
  81.  
  82. if ( $CATS == "true" ) then
  83.  
  84. mv ../.categories/Software.html /tmp
  85. mv ../.categories/companies.html /tmp
  86. mv ../.categories/products.html /tmp
  87. rm ../.categories/*
  88. mv /tmp/Software.html ../.categories
  89. mv /tmp/companies.html ../.categories
  90. mv /tmp/products.html ../.categories
  91.  
  92. echo "Creating category pages ..."
  93.  
  94. foreach cats  ( `cat categories.txt` )
  95.  
  96.  
  97.  
  98.  
  99.     set catword  = $cats
  100.  
  101.         foreach comp ( `ls ../` )
  102.         if ( ! -e ../$comp/_info ) then
  103.         echo "        $comp : no _info file"
  104.         endif
  105.  
  106.         if (-e ../$comp/_info ) then
  107.  
  108.         touch dbase.tmp
  109.  
  110.         nawk  -F^ ' BEGIN {  } \
  111.         { \
  112.         if ( $4 ~ /'"$catword"'/ ) print ""$1"^"$2"^'"$comp"'^" \
  113.         }' ../$comp/_info  >> ./dbase.tmp
  114.     endif
  115.     end
  116.  
  117. #
  118. # make text page
  119. #
  120.     echo ""
  121.     echo "     Creating $catword category page ..."
  122.     echo ""
  123.  
  124.     set letter = "A"
  125. #
  126. # Place appropriate applet reference in Hardware & Services
  127. #
  128. switch  ( "$catword" ) 
  129.     case "Hardware":
  130.     cat hard.head > ../.categories/$catword.html
  131.     breaksw
  132.  
  133.     case "Services":
  134.     cat serve.html > ../.categories/$catword.html
  135.     breaksw
  136.  
  137.     default:
  138.     cat head.html > ../.categories/$catword.html
  139. endsw
  140. # make a switch statement to convert sun to sun information, etc.
  141. #
  142.     echo "<H1>$catword </H1>" >> ../.categories/$catword.html
  143.     echo "</pre>" >> ../.categories/$catword.html
  144.     echo "<DL>" >> ../.categories/$catword.html
  145.  
  146.     echo '<B><FONT size="-1">' >> ../.categories/$catword.html
  147.     echo '<B>Search for--</b><A HREF="./'$catword'#A">A</A> <A HREF="./'$catword'#B">B</A> <A HREF="./'$catword'#C">C</A> <A HREF="./'$catword'#D">D</A>' >> ../.categories/$catword.html
  148.     echo '<A HREF="./'$catword'#E">E</A> <A HREF="./'$catword'#F">F</A> <A HREF="./'$catword'#G">G</A> <A HREF="./'$catword'#H">H</A>' >> ../.categories/$catword.html
  149.     echo '<A HREF="./'$catword'#I">I</A> <A HREF="./'$catword'#J">J</A> <A HREF="./'$catword'#K">K</A> <A HREF="./'$catword'#L">L</A>' >> ../.categories/$catword.html
  150.     echo '<A HREF="./'$catword'#M">M</A> <A HREF="./'$catword'#N">N</A> <A HREF="./'$catword'#O">O</A> <A HREF="./'$catword'#P">P</A>' >> ../.categories/$catword.html
  151.     echo '<A HREF="./'$catword'#Q">Q</A> <A HREF="./'$catword'#R">R</A> <A HREF="./'$catword'#S">S</A> <A HREF="./'$catword'#T">T</A>' >> ../.categories/$catword.html
  152.     echo '<A HREF="./'$catword'#U">U</A> <A HREF="./'$catword'#V">V</A> <A HREF="./'$catword'#W">W</A> <A HREF="./'$catword'#X">X</A>' >> ../.categories/$catword.html
  153.     echo '<A HREF="./'$catword'#Y">Y</A> <A HREF="./'$catword'#Z">Z</A>' >> ../.categories/$catword.html
  154.     echo '</FONT></B>' >> ../.categories/$catword.html
  155.     echo '<hr>' >> ../.categories/$catword.html
  156.     echo '<p>' >> ../.categories/$catword.html
  157.  
  158.  
  159.     nawk -F^ ' BEGIN {i=65;s=0;letter ="^A.*";rletter = "A"} {\
  160.     comp = $1;$7 = $1;href = gsub (/ /,"",$7) \
  161.     if ( comp !~ letter ) {\
  162.         for ( x=i;x<=100; ++x ){\
  163.         letter = sprintf("^%c.*", x)\
  164.         rletter = sprintf("%c", x)\
  165.         if ( comp ~ letter ) {i=x;s=0;break}\
  166.         }\
  167.     }\
  168.     if ( comp ~ letter && s==0 ) {\
  169.     print "<DT><A NAME=\""rletter"\"><B><B>"rletter"</B></B></A><br><DD><a href=http://localhost:7999/"$3"><B>"$1"</B></a>"$2"<br>";s=2 \
  170.     }\
  171.     if ( comp ~ letter && s==1) {\
  172.     print "     <DD><a href=http://localhost:7999/"$3"><B>"$1"</B></a>"$2"<br>"\
  173.     }\
  174.     s=1\
  175.     }' dbase.tmp  >> ../.categories/$catword.html
  176.  
  177.  
  178.     cat tail.html >> ../.categories/$catword.html
  179.  
  180. rm dbase.tmp
  181.  
  182. end
  183.  
  184. endif
  185.  
  186.  
  187.  
  188. #
  189. # Get all CDware menu bar components and put in file 
  190. # for building of front page applet 
  191. #
  192. if ( $APPLETS == "true" ) then
  193.  
  194.  
  195.  
  196. echo ""
  197. echo "Building Control bar applets ..."
  198. echo ""
  199.  
  200.  
  201. # If first line contains applet (ours), strip the applet 
  202.  
  203. echo "     Removing old applets ..."
  204.  
  205. foreach comp (`ls ../`) 
  206.     touch $comp.tmp
  207.     nawk 'BEGIN {s=0} {\
  208.     if ( $0 ~ "<app" && NR ==1 ) { \
  209.           s=1; break }\
  210.     if ( s==0 ) { print $0 } \
  211.       if ( $0 ~ ">" ) { s=0 }\
  212.     }' ../$comp/index.html >> $comp.tmp  
  213.     mv $comp.tmp ../$comp/index.html
  214. end
  215.  
  216. # see what each company has, build the tagRef to the applet accordingly
  217.  
  218. echo "     Creating new applets ..."
  219.  
  220.  
  221. setenv CDOPT 
  222.  
  223. foreach comp (`ls ../`)
  224.  
  225.         if ( ! -e ../$comp/_info ) then
  226.     echo "        $comp : no _info file" 
  227.         endif 
  228.  
  229.  
  230.  
  231.  
  232.     rm applet
  233.     touch applet
  234.     touch temp
  235.         if ( -e ../$comp/_info ) then
  236.  
  237.         setenv CDOPT  `nawk  -F^ ' BEGIN {s=0} { if ( $3 ~ /testdrive/ ) { s=1 }  if ( $3 ~ /install/ ) { s=(s+2) }  if ( $3 ~ /demo/ ) { s=(s+4) }  } END { print s }' ../$comp/_info`
  238.         switch ( "$CDOPT" )
  239.  
  240.                         case "8":
  241.             echo "WARNING: no applet for $comp ..."
  242.                         breaksw
  243.  
  244.             case "0":
  245.             echo '<app class=CDbar img="../CDware/images/none.gif"' >> applet
  246.             echo "highlight=brighter60" >> applet
  247.             echo "area1=HrefButtonArea,4,1,93,33,../CDware/index.html" >> applet
  248.             echo "area2=HrefButtonArea,98,1,97,33,../.wais/Catalog.html" >> applet
  249.             echo "area3=HrefButtonArea,197,1,95,33,http://localhost:7999/cgi-bin/req_more_info.pl?$comp" >> applet
  250.             echo ">" >> applet
  251.                         breaksw    
  252.  
  253.                         case "1":
  254.             echo '<app class=CDbar img="../CDware/images/td.gif"' >> applet
  255.                         echo "highlight=brighter60" >> applet
  256.                         echo "area1=HrefButtonArea,4,1,93,33,../CDware/index.html" >> applet
  257.                         echo "area2=HrefButtonArea,98,1,97,33,../.wais/Catalog.html" >> applet
  258.                         echo "area3=HrefButtonArea,197,1,95,33,http://localhost:7999/cgi-bin/req_more_info.pl?$comp" >> applet
  259.                         echo "area4=HrefButtonArea,400,1,95,33,http://localhost:7999/$comp/_install/run.sh" >> applet   
  260.                         echo ">" >> applet
  261.                         breaksw    
  262.  
  263.  
  264.                         case "2":
  265.                         echo '<app class=CDbar img="../CDware/images/ts.gif"' >> applet
  266.                         echo "highlight=brighter60" >> applet
  267.                         echo "area1=HrefButtonArea,4,1,93,33,../CDware/index.html" >> applet
  268.                         echo "area2=HrefButtonArea,98,1,97,33,../.wais/Catalog.html" >> applet
  269.                         echo "area3=HrefButtonArea,197,1,95,33,http://localhost:7999/cgi-bin/req_more_info.pl?$comp" >> applet
  270.                         echo "area4=HrefButtonArea,496,1,96,33,http://localhost:7999/$comp/_install/install.sh" >> applet
  271.                         echo ">" >> applet
  272.                         breaksw
  273.  
  274.  
  275.                         case "3":
  276.             echo '<app class=CDbar img="../CDware/images/tdts.gif"' >> applet
  277.                         echo "highlight=brighter60" >> applet
  278.                         echo "area1=HrefButtonArea,4,1,93,33,../CDware/index.html" >> applet
  279.                         echo "area2=HrefButtonArea,98,1,97,33,../.wais/Catalog.html" >> applet
  280.                         echo "area3=HrefButtonArea,197,1,95,33,http://localhost:7999/cgi-bin/req_more_info.pl?$comp" >> applet
  281.                         echo "area4=HrefButtonArea,400,1,95,33,http://localhost:7999/$comp/_install/run.sh" >> applet   
  282.                         echo "area5=HrefButtonArea,496,1,96,33,http://localhost:7999/$comp/_install/install.sh" >> applet
  283.                         echo ">" >> applet
  284.                         breaksw    
  285.  
  286.  
  287.                         case "4":
  288.             echo '<app class=CDbar img="../CDware/images/rd.gif"' >> applet
  289.                         echo "highlight=brighter60" >> applet
  290.                         echo "area1=HrefButtonArea,4,1,93,33,../CDware/index.html" >> applet
  291.                         echo "area2=HrefButtonArea,98,1,97,33,../.wais/Catalog.html" >> applet
  292.                         echo "area3=HrefButtonArea,197,1,95,33,http://localhost:7999/cgi-bin/req_more_info.pl?$comp" >> applet
  293.                         echo "area4=HrefButtonArea,304,1,93,33,http://localhost:7999/$comp/_install/install_show.sh" >> applet
  294.                         echo ">" >> applet
  295.                         breaksw    
  296.  
  297.  
  298.                         case "5":
  299.             echo '<app class=CDbar img="../CDware/images/tdrd.gif"' >> applet
  300.                         echo "highlight=brighter60" >> applet
  301.                         echo "area1=HrefButtonArea,4,1,93,33,../CDware/index.html" >> applet
  302.                         echo "area2=HrefButtonArea,98,1,97,33,../.wais/Catalog.html" >> applet
  303.                         echo "area3=HrefButtonArea,197,1,95,33,http://localhost:7999/cgi-bin/req_more_info.pl?$comp" >> applet
  304.                         echo "area4=HrefButtonArea,304,1,93,33,http://localhost:7999/$comp/_install/install_show.sh" >> applet
  305.                         echo "area5=HrefButtonArea,400,1,95,33,http://localhost:7999/$comp/_install/run.sh" >> applet   
  306.                         echo ">" >> applet
  307.                         breaksw    
  308.  
  309.  
  310.                         case "6":
  311.             echo '<app class=CDbar img="../CDware/images/tsrd.gif"' >> applet
  312.                         echo "highlight=brighter60" >> applet
  313.                         echo "area1=HrefButtonArea,4,1,93,33,../CDware/index.html" >> applet
  314.                         echo "area2=HrefButtonArea,98,1,97,33,../.wais/Catalog.html" >> applet
  315.                         echo "area3=HrefButtonArea,197,1,95,33,http://localhost:7999/cgi-bin/req_more_info.pl?$comp" >> applet
  316.                         echo "area4=HrefButtonArea,304,1,93,33,http://localhost:7999/$comp/_install/install_show.sh" >> applet
  317.                         echo "area5=HrefButtonArea,496,1,96,33,http://localhost:7999/$comp/_install/install.sh" >> applet
  318.                         echo ">" >> applet
  319.                         breaksw    
  320.  
  321.  
  322.                         case "7":
  323.             echo '<app class=CDbar img="../CDware/images/samplebar.gif"' >> applet
  324.                         echo "highlight=brighter60" >> applet
  325.                         echo "area1=HrefButtonArea,4,1,93,33,../CDware/index.html" >> applet
  326.                         echo "area2=HrefButtonArea,98,1,97,33,../.wais/Catalog.html" >> applet
  327.                         echo "area3=HrefButtonArea,197,1,95,33,http://localhost:7999/cgi-bin/req_more_info.pl?$comp" >> applet
  328.                         echo "area4=HrefButtonArea,304,1,93,33,http://localhost:7999/$comp/_install/install_show.sh" >> applet
  329.                         echo "area5=HrefButtonArea,400,1,95,33,http://localhost:7999/$comp/_install/run.sh" >> applet   
  330.                         echo "area6=HrefButtonArea,496,1,96,33,http://localhost:7999/$comp/_install/install.sh" >> applet
  331.                         echo ">" >> applet
  332.                         breaksw    
  333.         
  334.             default:
  335.                 echo " WARNING: There is no applet for $comp"
  336.     endsw
  337.  
  338.  
  339.             nawk ' {print $0} ' applet ../$comp/index.html >> temp
  340.             mv temp ../$comp/index.html
  341.     endif
  342. end
  343.  
  344. endif
  345.  
  346. #
  347. # Compile list of companies, place in 'companies' file
  348. #
  349. if ( $COMP == true ) then
  350.  
  351.  
  352. echo ""
  353. echo "Compiling Company Names ..."
  354. echo ""
  355.  
  356. touch comp.tmp
  357. foreach comp (`ls ../`)
  358. set old_dir = `pwd`
  359. cd ../$comp
  360. if ( -e _info ) then
  361. set NUM_PROD = `wc -l _info | sed -e 's/^ *//' | cut -f1 -d" "` 
  362.    nawk -F^ 'BEGIN {s=0} {if ( NR == 1 ) {\
  363.    printf ("%s^%s^'$comp'^",$1,$2)\
  364. } }' _info >> ../.bin/comp.tmp
  365.  
  366.    nawk -F^ 'BEGIN {s=0} { if ( NR !=1 ) { printf ("%s",$1)}\
  367.    if ( NR <= ("'$NUM_PROD'" - 1 ) && NR != 1) {printf ("\, ")}  } END { printf ("^\n")} ' _info >> ../.bin/comp.tmp
  368. endif
  369. cd $old_dir
  370. end
  371. sort -o companies comp.tmp 
  372.  
  373. # make text page
  374.  
  375.         echo ""
  376.         echo "     Creating Companies page ..."
  377.         echo ""
  378.  
  379.         set letter = "A"
  380.  
  381.         cat head.html > ../.categories/companies.html
  382.     echo '<app class=CDbar img="../CDware/images/companies.gif"' >> ../.categories/companies.html
  383.     echo 'highlight=brighter60' >> ../.categories/companies.html
  384.     echo 'area1=HrefButtonArea,27,4,69,40,../.categories/services.html' >> ../.categories/companies.html
  385.     echo 'area2=HrefButtonArea,27,36,69,90,../.categories/products.html' >> ../.categories/companies.html
  386.     echo 'area3=HrefButtonArea,96,0,69,40,../.categories/Hardware.html' >> ../.categories/companies.html
  387.     echo 'area4=HrefButtonArea,96,38,69,74,../.categories/Software.html>' >> ../.categories/companies.html
  388.  
  389.         echo '<DL>' >> ../.categories/companies.html
  390.  
  391.         echo '<B><FONT size="-1">' >> ../.categories/companies.html
  392.         echo '<B>Search for--</b><A HREF="./companies.html#A">A</A> <A HREF="./companies.html#B">B</A> <A HREF="./companies.html#C">C</A> <A HREF="./companies.html#D">D</A>' >> ../.categories/companies.html
  393.         echo '<A HREF="./companies.html#E">E</A> <A HREF="./companies.html#F">F</A> <A HREF="./companies.html#G">G</A> <A HREF="./companies.html#H">H</A>' >> ../.categories/companies.html
  394.         echo '<A HREF="./companies.html#I">I</A> <A HREF="./companies.html#J">J</A> <A HREF="./companies.html#K">K</A> <A HREF="./companies.html#L">L</A>' >> ../.categories/companies.html
  395.         echo '<A HREF="./companies.html#M">M</A> <A HREF="./companies.html#N">N</A> <A HREF="./companies.html#O">O</A> <A HREF="./companies.html#P">P</A>' >> ../.categories/companies.html
  396.         echo '<A HREF="./companies.html#Q">Q</A> <A HREF="./companies.html#R">R</A> <A HREF="./companies.html#S">S</A> <A HREF="./companies.html#T">T</A>' >> ../.categories/companies.html
  397.         echo '<A HREF="./companies.html#U">U</A> <A HREF="./companies.html#V">V</A> <A HREF="./companies.html#W">W</A> <A HREF="./companies.html#X">X</A>' >> ../.categories/companies.html
  398.         echo '<A HREF="./companies.html#Y">Y</A> <A HREF="./companies.html#Z">Z</A>' >> ../.categories/companies.html
  399.         echo '</FONT></B>' >> ../.categories/companies.html
  400.         echo '<hr>' >> ../.categories/companies.html
  401.         echo '<p>' >> ../.categories/companies.html
  402.  
  403.  
  404.         nawk -F^ ' BEGIN {i=65;s=0;letter ="^A.*";rletter = "A"} {\
  405.         comp = $1; \
  406.         if ( comp !~ letter ) {\
  407.                 for ( x=i;x<=100; ++x ){\
  408.                 letter = sprintf("^%c.*", x)\
  409.                 rletter = sprintf("%c", x)\
  410.                 if ( comp ~ letter ) {i=x;s=0;break}\
  411.                 }\
  412.         }\
  413.         if ( comp ~ letter && s==0 ) {\
  414.         printf ("<DT><A NAME=\""rletter"\"><B><B>"rletter"</B></B></A><DD><a href=http://localhost:7999/"$3"><B>"$1"</B></a>"$2"")\
  415.     print "<dd><b><i>"$4"</i></b><br>" ;s=2 \
  416.         }\
  417.         if ( comp ~ letter && s==1) {\
  418.         print "     <DD><a href=http://localhost:7999/"$3"><B>"$1"</B></a>"$2""\
  419.         print "<dd><b><i>"$4"</i></b><br>" \
  420.         }\
  421.         s=1\
  422.         }' comp.tmp  >> ../.categories/companies.html
  423.  
  424.  
  425.         cat tail.html >> ../.categories/companies.html
  426.  
  427. rm comp.tmp
  428.  
  429. endif 
  430.  
  431. #
  432. # Compile list of products, place in 'products' file
  433. #
  434. if ( $PROD == true ) then
  435.  
  436.  
  437.  
  438. echo ""
  439. echo "Compiling Products ..."
  440. echo ""
  441.  
  442. touch prod.tmp
  443. foreach comp (`ls ../`)
  444. if ( -e ../$comp/_info ) then
  445.    nawk -F^ 'BEGIN {s=0} { \
  446.         if ( NR == 1 ) { company = $1 } \
  447.         if ( NR !=1 ) { print ""$1"^'$comp'^"company"^" } }' ../$comp/_info >> prod.tmp
  448. endif
  449. end
  450. sort -f -o products prod.tmp 
  451.  
  452.  
  453.         echo "     Creating Products page ..."
  454.         echo ""
  455.  
  456.         set letter = "A"
  457.  
  458.         cat head.html > ../.categories/products.html
  459.         echo '<app class=CDbar img="../CDware/images/products.gif"' >> ../.categories/products.html
  460.         echo 'highlight=brighter60' >> ../.categories/products.html
  461.         echo 'area1=HrefButtonArea,27,4,69,40,../.categories/companies.html' >> ../.categories/products.html
  462.         echo 'area2=HrefButtonArea,27,36,69,90,../.categories/services.html' >> ../.categories/products.html
  463.         echo 'area3=HrefButtonArea,96,0,69,40,../.categories/Hardware.html' >> ../.categories/products.html
  464.         echo 'area4=HrefButtonArea,96,38,69,74,../.categories/Software.html>' >> ../.categories/products.html
  465.  
  466.         echo "<DL>" >> ../.categories/products.html
  467.  
  468.         echo '<B><FONT size="-1">' >> ../.categories/products.html
  469.         echo '<B>Search for--</b><A HREF="./products.html#A">A</A> <A HREF="./products.html#B">B</A> <A HREF="./products.html#C">C</A> <A HREF="./products.html#D">D</A>' >> ../.categories/products.html
  470.         echo '<A HREF="./products.html#E">E</A> <A HREF="./products.html#F">F</A> <A HREF="./products.html#G">G</A> <A HREF="./products.html#H">H</A>' >> ../.categories/products.html
  471.         echo '<A HREF="./products.html#I">I</A> <A HREF="./products.html#J">J</A> <A HREF="./products.html#K">K</A> <A HREF="./products.html#L">L</A>' >> ../.categories/products.html
  472.         echo '<A HREF="./products.html#M">M</A> <A HREF="./products.html#N">N</A> <A HREF="./products.html#O">O</A> <A HREF="./products.html#P">P</A>' >> ../.categories/products.html
  473.         echo '<A HREF="./products.html#Q">Q</A> <A HREF="./products.html#R">R</A> <A HREF="./products.html#S">S</A> <A HREF="./products.html#T">T</A>' >> ../.categories/products.html
  474.         echo '<A HREF="./products.html#U">U</A> <A HREF="./products.html#V">V</A> <A HREF="./products.html#W">W</A> <A HREF="./products.html#X">X</A>' >> ../.categories/products.html
  475.         echo '<A HREF="./products.html#Y">Y</A> <A HREF="./products.html#Z">Z</A>' >> ../.categories/products.html
  476.         echo '</FONT></B>' >> ../.categories/products.html
  477.         echo '<hr>' >> ../.categories/products.html
  478.         echo '<p>' >> ../.categories/products.html
  479.  
  480.  
  481.         nawk -F^ ' BEGIN {i=65;s=0;lowcase ="^a.*";letter ="^A.*";rletter = "A"} {\
  482.         comp = $1; \
  483.         if ( comp !~ letter && comp !~ lowcase ) {\
  484.                 for ( x=i;x<=100; ++x ){\
  485.         l = (x + 32)\
  486.                 letter = sprintf("^%c.*", x)\
  487.                 lowcase = sprintf("^%c.*", l)\
  488.                 rletter = sprintf("%c", x)\
  489.                 if ( comp ~ letter || comp ~ lowcase ) {i=x;s=0;break}\
  490.                 }\
  491.         }\
  492.         if ( (comp ~ letter || comp ~ lowcase ) && s==0 ) {\
  493.         printf ("<DT><A NAME=\""rletter"\"><B><B>"rletter"</B></B></A><DD><a href=http://localhost:7999/"$2"><B>"$1 "</B></a><i> from </i><b>"$3"</b>")\
  494.         print "<br>" ;s=2 \
  495.         }\
  496.         if ( (comp ~ letter || comp ~ lowcase) && s==1) {\
  497.         print "     <DD><a href=http://localhost:7999/"$2"><B>"$1 "</B></a><i> from </i><b>"$3"</b>"\
  498.         print "<br>" \
  499.         }\
  500.         s=1\
  501.         }' products  >> ../.categories/products.html
  502.  
  503.  
  504.         cat tail.html >> ../.categories/products.html
  505.  
  506. rm prod.tmp
  507.  
  508. endif
  509.  
  510.  
  511.  
  512.  
  513.  
  514.